package com.hh.spare.mapper;

import com.hh.spare.bean.Spare;
import com.hh.spare.vo.QuerySetSpareVo;
import com.hh.spare.vo.SpareVo;
import com.hh.spare.vo.StatusChangeVo;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface SpareMapper {
    List<Spare> selectAllSpareByPage(SpareVo spareVo);

    int insert(Spare record);

    Spare selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Spare record);

    int updateStatusById(StatusChangeVo statusChangeVo);

    List<Spare> selectAllById(Integer id);

    Integer selectSpareId(String spareCode);

    Integer judgeAddSpareCodeIsExist(String spareCode);

    Integer judgeAddSpareNameIsExist(String spareName);

    Integer judgePlanCategoryStatus(Integer planCategoryId);

    Integer judgeSubClassStatus(Integer subClassId);

    Integer judgeLegalPersonStatus(Integer legalPersonId);

    Integer judgeUpdateSpareNameIsExist(Integer id, String spareName);

    Integer judgeUpdateSpareCodeIsExist(Integer id, String spareCode);

    Integer getAllSpare(SpareVo spareVo);

    List<QuerySetSpareVo> getSpareForWeb(SpareVo spareVo);

    Integer getSpareIdByCode(String materialCode);
}